/* Tells which operating system you use depending on the command shell */
os = .operating_system~new /* create a new object */
os~write_command_shell /* invoke the method to do the work */
exit 0
::class operating_systems /* class with 2 methods */
::method init /* method prompts for shell name */
expose shell /* EXPOSE the shared attribute */
say 'Enter the shell name:'
parse pull shell
return
::method write_command_shell /* method determines the OS */
expose shell
select /* determines the OS for this shell */
when shell = 'CMD' then string = 'DOS or Windows 9x'
when shell = 'COMMAND' then string = 'Windows 2k/2003/XP'
when shell = 'ksh' then string = 'Korn Shell'
when shell = 'csh' then string = 'C Shell'
otherwise string = 'unknown'
end
say 'OS is:' string
return 0